<?php
/**
 * Created by PhpStorm.
 * User: Sky
 * Date: 16/1/27
 * Time: 上午10:29
 */

use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

$web = Url::to("@web");

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>礼包产品列表</title>
    <link type="text/css" href="<?= $web ?>/css/bag/goods-custom-list.css" rel="stylesheet"/>
    <link type="text/css" href="<?= $web ?>/css/bag/global.css" rel="stylesheet"/>

    <script type="text/javascript" src="<?= $web ?>/js/jquery.js"></script>
    <script type="text/javascript" src="<?= $web ?>/js/tools.js"></script>
    <script type="application/javascript">
        $(document).ready(function () {
            var w = $(document).width();
            if (w > 640) {
                w = 640;
            }
            $("body").css("font-size", w * 20 / 320);


            $('.buy-frame').click(function(){
                var data = {};
                data.DORABAGID='<?=$bag_id?>';
                var re = returnjson("<?=Url::to(['wx-bag/submit-goods-custom-handle'])?>", data);
                if (re.flag == 0) {
                    alert(re.msg);
                    return;
                } else {

                    window.location.href = "<?=Url::to(["wx-bag/view-order-nav"]);?>?code="+re.re;

                }
            });


        });
        function href_goods_detail(goods_code) {
            goods_code = encodeURI(goods_code);
            window.location.href = "<?=Url::to(["wx-bag/goods-detail"]);?>?goods_code=" + goods_code;
        }
    </script>
</head>
<body>
<div class="main">
    <div id="list_frame" style="overflow: auto;">
        <ul class="list-frame">
            <?php
            foreach($goods_list as $goods) {
                ?>
                <li>
                    <div class="item-frame" onclick="href_goods_detail('<?=$goods['GOODS_CODE']?>')">
                        <img class="goods-img" src="<?= $goods['GOODS_IMG_URL'] ?>">
                        <div class="goods-name"><label><?= $goods['GOODS_NAME'] ?></label></div>
                        <div class="goods-price"><label class="price-symbol">¥</label><label class="price"><?= $goods['PRICE'] ?></label>
                        </div>
                        <div class="goods-num-frame">
                            <label class="txt">数量</label><label class="txt-1">&nbsp;&nbsp;x</label><label
                                class="txt"><?= $goods['GOODS_SL'] ?></label>
                        </div>
                    </div>
                </li>
                <?php
            }
            ?>
        </ul>
    </div>
    <div style="height: 2.5em;"></div>
    <div class="bottom-frame">
        <div class="price-frame">
            <label class="txt">礼包支付价:</label>
            <label class="txt-1">￥</label>
            <label class="txt-2"><?= $total_price ?></label>
        </div>
        <div class="buy-frame">
            <label>购买此礼包</label>
        </div>
    </div>
</div>
</body>
</html>
